<?php

  //
  // Memorii Web
  // script/delete_word.php
  //
  // Delete a word
  //
  
  session_start();
  
  require_once('../const.php');
  require_once('../db/db.php');
  
  $word_id = '0';
  if( isset($_SESSION['current_word_id'])) {
  	$word_id = $_SESSION['current_word_id'];
  }
  
  $db_connection = db_connect();
  db_delete_word($db_connection, $word_id);
  echo '<div class="msg">Word deleted.</div>';
  
  // Disconnect database
  db_disconnect($db_connection);

  include('../../content/folder.php');
?>